﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpRenderingInterface.h"
#include "IEvent.h"
#include "GbmpQuickCast.h"

namespace gcmp
{
    class ICanvasEventHandler;
    class ICanvas;

    /// \brief 场景事件接口
    class GCMP_RENDERING_INTERFACE_EXPORT ICanvasEvent : public IEvent
    {
        DEFINE_CAST_DERIVED(gcmp::ICanvasEvent, gcmp::IEvent);
    public:
        /// \brief 增加事件接收者
        ///
        /// \param pHandler 事件接收者
        /// \return 是否成功
        virtual bool Add(ICanvasEventHandler* pHandler) = 0;
        
        /// \brief 去除事件接收者
        ///
        /// \param pHandler 事件接收者
        /// \return 是否成功
        virtual bool Delete(ICanvasEventHandler* pHandler) = 0;
        
        /// \brief 获取事件发送方
        ///
        /// \return 事件发送方
        virtual ICanvas* GetSender() const = 0;
    };
}

